<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/ingredientsarea/IngredientsArea.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/ingredientsarea/IngredientsArea.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '配料区管理',
                name: 'ingredientsarea/IngredientsArea',
                url: "/IngredientsArea/",
                sortName: "RegionNo",
                foreignKey:"IngredientsAreaId"
            });
            const editFormFields = ref({"Region":"","RegionNo":"","MaterialName":"","BatchingMaterial":"","BatchingBatch":"","BatchingRemainingWeight":"","BatchingState":"","MaterialName1":"","MaterialPreparationMaterial":"","MaterialPreparationBatch":"","MaterialPreparationWeight":"","MaterialPreparationType":"","State":""});
            const editFormOptions = ref([[{"title":"区域","field":"Region"},
                               {"title":"区域编号","field":"RegionNo"},
                               {"title":"当前配料台物料号","field":"MaterialName"}],
                              [{"title":"当前配料台料箱号","field":"BatchingMaterial"},
                               {"title":"当前配料台物料批号","field":"BatchingBatch"},
                               {"title":"当前配料台剩余重量","field":"BatchingRemainingWeight","type":"decimal"}],
                              [{"title":"配料台状态","field":"BatchingState","type":"number"},
                               {"title":"备料区料物号","field":"MaterialName1"},
                               {"title":"备料区料箱号","field":"MaterialPreparationMaterial"}],
                              [{"title":"备料区物料批号","field":"MaterialPreparationBatch"},
                               {"title":"备料区物料重量","field":"MaterialPreparationWeight","type":"decimal"},
                               {"title":"备料区域状态","field":"MaterialPreparationType"}],
                              [{"dataKey":"enable","data":[],"title":"状态","field":"State","type":"select"}]]);
            const searchFormFields = ref({"RegionNo":""});
            const searchFormOptions = ref([[{"title":"区域编号","field":"RegionNo"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Region',title:'区域',type:'string',width:110,align:'left',sort:true},
                       {field:'RegionNo',title:'区域编号',type:'string',link:true,width:110,align:'left'},
                       {field:'MaterialName',title:'当前配料台物料号',type:'string',width:110,align:'left'},
                       {field:'BatchingMaterial',title:'当前配料台料箱号',type:'string',width:110,align:'left'},
                       {field:'BatchingBatch',title:'当前配料台物料批号',type:'string',width:110,align:'left'},
                       {field:'BatchingRemainingWeight',title:'当前配料台剩余重量',type:'decimal',width:110,align:'left'},
                       {field:'BatchingState',title:'配料台状态',type:'int',width:110,align:'left'},
                       {field:'MaterialName1',title:'备料区料物号',type:'string',width:110,align:'left'},
                       {field:'MaterialPreparationMaterial',title:'备料区料箱号',type:'string',width:110,align:'left'},
                       {field:'MaterialPreparationBatch',title:'备料区物料批号',type:'string',width:110,align:'left'},
                       {field:'MaterialPreparationWeight',title:'备料区物料重量',type:'decimal',width:110,align:'left'},
                       {field:'MaterialPreparationType',title:'备料区域状态',type:'string',width:110,align:'left'},
                       {field:'State',title:'状态',type:'int',bind:{ key:'enable',data:[]},width:110,align:'left'}]);
            const detail = ref({
                cnName: "配料区料箱移动记录",
                table: "IngredientsAreaMove",
                columns: [{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'IngredientsAreaId',title:'配料区ID',type:'string',width:110,hidden:true,align:'left'},
                       {field:'RegionNo',title:'配料区位置号',type:'string',width:110,align:'left',sort:true},
                       {field:'MaterialBoxNo',title:'移动料箱号',type:'string',width:110,align:'left'},
                       {field:'Types',title:'移动类别',type:'int',bind:{ key:'移动类别',data:[]},width:110,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true}],
                sortName: "CreateDate",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
